<?php
namespace app\custom_user\controller;

use app\custom_user\model\UserSession;
use cmf\controller\HomeBaseController;

/**
 * 需要用户权限的控制器的基类
 */
class UserBaseController extends HomeBaseController
{
    protected function checkLogin()
    {
        $user=UserSession::get("user");
        if(!$user){
            $this->error("用户未登录",url("custom_user/public/login"));
        }
        return $user;
    }
}
